//list
dTA.creSelect(
    function(){
        dTA.ta.find('.ui-selected .sl-h').draggable({helper: 'clone',
                           start :function(){
                                $('#sort_tree .sl-i').droppable({hoverClass: "ui-state-active", drop:function(){
                                    var ids = dTA.getSelect_ids(), sid = $(this).attr('i_ID'); 
                                    if (!ids)return false;
                                    if (!sid || sid=='null')return;
                                    $.get(c_U + '-faddSort', 'id='+ids+'&sort_id='+ sid, checAjaxRe);
                                }});
                            },
                            stop:function(){$('#sort_tree .sl-i').droppable('destroy');}
        }); 
    },
    function(){
        dTA.ta.find('.ui-draggable').draggable('destroy');
    }
);
          
// tool
tBar.addBut('new', function(){w_open(c_U+'-fpost',null,800);})
	.addBut('remove', function(){
        var sid = $('#sort_tree .active').attr('i_ID');
        if (!sid || sid=='null')
            return alert('请选择分类');
        var ids =  dTA.getSelect_ids()
		if(!ids || !confirm('移除分类'))return;
        $.get(c_U + '-fremoveSort&id='+ids + '&sort_id=' + sid, function(r){
                            if(checAjaxRe(r))dTA.ta.find('.ui-selected:visible').remove();});
	  })
	  .addBut('del');
      
//sort
sortTree = $('#sort_tree');
dirTree_li(sortTree,  c_U + '-fsort&id=');
sortTree.append('<p class="sl-i" i_ID="null"><b class="hand"></b>未归类</p>');
$('.sl-i', sortTree).live('click', function(){$('#s_sort_id')[0].value = $(this).attr('i_ID');lp.getData();});     
 
//search
function s(){
    $('#s_sort_id').val('');
    var a= $('#l_ajax_loading').removeClass('noVis');
    $.post( c_U + '-flist_a&'+ $('#s_form_other').serialize(), $('#search_form').serialize(), function(r){a.addClass('noVis');lp.showData(r);});
}